#define   _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>

void main(){

	int a = 0, b = 0, c = 0, i = 0;

	for (i = 100; i <= 999; i++)
	{
		a = i / 100;
		b = i % 10;
		if (a == b)
		{
			printf("%d ",i);
			c++;
			if (c%8==0)
			{
				printf("\n");
			}
		}
	}
}